<?php

namespace App\Http\Controllers\Api\InnerApi;

use Illuminate\Http\Request;

class StatisticsController extends InnerApiBaseController
{
    /**
     * 统计数据概
     *
     * @param Request $request
     * @return \Psr\Http\Message\StreamInterface
     */
    public function survey(Request $request)
    {
        $client  = $this->newHttp();
        $res = $client->request('POST','statistics/Survey',['form_params'=>$request->all()]);

        return $res->getBody();
    }

    /**
     * 收入统计信息
     *
     * @param Request $request
     * @return \Psr\Http\Message\StreamInterface
     */
    public function income(Request $request)
    {
        $client  = $this->newHttp();
        $res = $client->request('POST','statistics/Income',['form_params'=>$request->all()]);

        return $res->getBody();
    }

    /**
     * 流量统计信息
     *
     * @param Request $request
     * @return \Psr\Http\Message\StreamInterface
     */
    public function traffic(Request $request)
    {
        $client  = $this->newHttp();
        $res = $client->request('POST','statistics/Traffic',['form_params'=>$request->all()]);

        return $res->getBody();
    }
}
